<template>
  <div class="articles-container">
  <el-card class="box-card">
    <el-form ref="formRef" :model="form" :rules="rules" size="small" label-width="100px">
      <el-row :gutter="15">
        <el-col :span="12">
          <el-form-item label="关键字" prop="keywords">
            <el-input v-model="form.keywords" placeholder="请输入关键字" clearable :style="{width: '100%'}">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="状态" prop="status">
            <el-select v-model="form.status" placeholder="请选择状态" clearable :style="{width: '100%'}">
              <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.label"
                :value="item.value" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
    </el-card>
    </div>
</template>

<script>
export default {
  components: {},
  props: [],
  data () {
    return {
      form: {
        keywords: undefined,
        status: ''
      },
      rules: {
        keywords: [],
        status: []
      },
      statusOptions: [{
        label: '启用',
        value: 1
      }, {
        label: '禁用',
        value: 2
      }]
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {},
  methods: {
    submitForm () {
      this.$refs.formRef.validate(valid => {
        if (!valid) {
          console.log(1)
        }
      })
    },
    resetForm () {
      this.$refs.formRef.resetFields()
    }
  }
}

</script>

<style scoped lang='less'></style>
